package com.itheima.mapper;

import com.itheima.pojo.Emp;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;

/**
 * 员工管理
 */
@Mapper
public interface EmpMapper {
//    @Select("select count(*) from emp;")
//    Integer count();
//
//    @Select("select * from emp limit #{start}, #{pageSize};")
//    List<Emp> page(Integer start, Integer pageSize);

    //@Select("select * from emp")
    List<Emp> list(String name, Short gender, LocalDate begin, LocalDate end);

    void del(List<Integer> ids);

    void sava(Emp emp);

    @Select("select * from emp where id = #{id};")
    Emp getById(Integer id);


    void edit(Emp emp);


    @Select("select * from emp where username = #{username} and password = #{password}")
    Emp getUsernameAndPassword(Emp emp);


    /**
     *
     */

    @Delete("delete from emp where dept_id = #{id};")
    void sc(Integer id);
}
